package server.util;

import server.db.DBFactory;

public class DBUtils {
    public static Integer getInsertId(String id) {
        String biaoname = id.substring(0, id.lastIndexOf('_'));
        String sql = "select max(" + id + ") as id from " + biaoname;
        String lastId = DBFactory.getDBDriver().queryOne(sql);
        if (lastId != null) {
            return Integer.parseInt(lastId);
        } else return 0;
    }
}
